<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:70:"E:\phpStudy\PHPTutorial\WWW\yzf/application/admin\view\shop\index.html";i:1556552364;s:71:"E:\phpStudy\PHPTutorial\WWW\yzf\application\admin\view\common\head.html";i:1556002984;}*/ ?>
<!DOCTYPE html>
<html>
  
  <head>
    <meta charset="UTF-8">
    <title>聚财国际</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="/public/static/css/font.css"> 
	<link href="/favicon.ico" type="image/x-icon" rel="shortcut icon" /> 
    <link rel="stylesheet" href="/public/static/css/xadmin.css">
    <link href="/public/static/lib/layui/css/layui.css" rel="stylesheet">
    <script type="text/javascript" src="/public/static/js/jquery.min.js"></script>
    <script type="text/javascript" src="/public/static/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/public/static/js/xadmin.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script type="text/css">
      #fff{
        border: red solid 1px;
      }
    </script>
  </head>
  
<body>
<div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">演示</a>
        <a>
          <cite>商户列表</cite></a>
      </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="<?php echo url('admin/shop/index'); ?>" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>

</div>


    <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so">
            <button type="button" class="layui-btn" onclick="x_admin_show('添加商户','<?php echo url('admin/shop/insert'); ?>')"><i class="layui-icon"></i>添加商户</button>
        </form>
    </div>
    <form class="layui-form" action="" method="post">
    <table class="layui-table">
        <thead>
        <tr style="text-align: center">
            <th style="text-align: center">NO</th>
            <th style="text-align: center">商户账号</th>
            <th style="text-align: center">商户名</th>
            <th style="text-align: center">手机号</th>
            <th style="text-align: center">商户密钥</th>
            <th style="text-align: center">创建时间</th>
            <th style="text-align: center">状态</th>
            <th style="text-align: center">余额</th>
            <th style="text-align: center">操作</th>
        </tr>
        </thead>
        <tbody>
        <?php if(is_array($user) || $user instanceof \think\Collection || $user instanceof \think\Paginator): $key = 0; $__LIST__ = $user;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$user): $mod = ($key % 2 );++$key;?>
        <tr style="text-align: center">
            <td><?php echo $key; ?></td>
            <td><?php echo $user['shopid']; ?></td>
            <td><?php echo $user['username']; ?></td>
            <td><?php echo $user['phone']; ?></td>
            <td><?php echo $user['appkey']; ?></td>
            <td><?php echo $user['createtime']; ?></td>
            <td><?php if($user['status']==1): ?>正常<?php else: ?>锁定<?php endif; ?></td>
            <td><?php echo $user['money']; ?></td>
            <td><input type="checkbox" <?php if ($user['status'] ==0): ?>  checked="" <?php endif; ?> name="status[]" lay-skin="switch" lay-filter="Suodoing" lay-text="锁定|解锁" value="<?php echo $user['shopid']; ?>"></td>
        </tr>
        <?php endforeach; endif; else: echo "" ;endif; ?>
        </tbody>
    </table>
    </form>
    <div class="page">
        <div>
            <?php echo $page; ?>
        </div>
    </div>

</div>
<script>
    layui.use(['laydate','form'], function() {
        var laydate = layui.laydate;
        var form = layui.form;
        form.on('switch(Suodoing)', function (data) {
            var shopid = data.value;
            // alert(shopid);
            //监听提交
            $.ajax({
                url: "<?php echo url('admin/shop/suoding'); ?>",
                type: "post",
                dataType: "JSON",
                data: {shopid: shopid},
                success: function (res) {
                    if (res == 1) {
                        layer.msg('操作成功！');
                        return false;
                    } else {
                        layer.msg('操作失败！');
                        return false;
                    }
                }
            });
        });
    })
</script>

</body>

</html>